package com.tz.crm.entity;

import javax.persistence.*;

/**
 * 顾客地址类
 * Created by Meicheng on 2016/12/22.
 */
@Entity
@Table(name = "tbl_customer_address")
public class Address extends BaseEntity {

    private static final long serialVersionUID = 2738227059626039762L;

    private double lng;
    private double lat;
    private String addrStr;
    private Customer customer;

    /**
     * 空参构造
     */
    public Address() {
    }

    /**
     * 有参构造
     *
     * @param lng     lng
     * @param lat     lat
     * @param addrStr addrStr
     */
    public Address(double lng, double lat, String addrStr) {
        this.lng = lng;
        this.lat = lat;
        this.addrStr = addrStr;
    }

    @Column(nullable = false)
    public double getLng() {
        return lng;
    }

    public void setLng(double lng) {
        this.lng = lng;
    }

    @Column(nullable = false)
    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    @Column(nullable = false)
    public String getAddrStr() {
        return addrStr;
    }

    public void setAddrStr(String addrStr) {
        this.addrStr = addrStr;
    }

    @ManyToOne
    @JoinColumn(name = "customer_id")
    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    @Override
    public String toString() {
        return "Address{" +
                "lng=" + lng +
                ", lat=" + lat +
                ", addrStr='" + addrStr + '\'' +
                '}';
    }
}
